#coding=utf-8

import sys
reload(sys)
sys.setdefaultencoding('gbk')

import HTMLParser
html_parser = HTMLParser.HTMLParser()

s = "&lt;p&gt;&lt;img src=&quot;/media/static/media/article/url_20170819142552.bmp&quot; title=&quot;&quot; alt=&quot;url.bmp&quot;/&gt;\u6d9b\u6d9b &lt;br/&gt; &lt;/p&gt;&lt;p&gt;&lt;img src=&quot;http://img.baidu.com/hi/jx2/j_0028.gif&quot;/&gt; &lt;/p&gt;"
s = s.encode('gb2312')
print s
print html_parser.unescape(s)
print unicode(html_parser.unescape(s))
